#include "resultmenu.h"

ResultMenu::ResultMenu(QWidget*parent):QWidget(parent){
    QVBoxLayout*layout=new QVBoxLayout(this);

    resultLabel=new QLabel("",this);
    resultLabel->setAlignment(Qt::AlignCenter);
    resultLabel->setStyleSheet("font-size:48px;font-weight:bold;");

    menuButton=new QPushButton("返回主菜单",this);
    menuButton->setStyleSheet("font-size:24px;padding:10px");

    layout->addStretch();
    layout->addWidget(resultLabel);
    layout->addStretch();
    layout->addWidget(menuButton);
    layout->addStretch();

    connect(menuButton,&QPushButton::clicked,this,&ResultMenu::returnToMenu);
}

void ResultMenu::setResult(bool win){
    if(win){
        resultLabel->setText("呀嘞呀嘞daze");
    }else{
        resultLabel->setText("失败了");
    }
}
